package com.jhxy.algorithm.util;

import java.util.LinkedList;
import java.util.List;

public class InputsForMaxProfit {
    public List<List<Object>> inputs = new LinkedList<>();
    public InputsForMaxProfit(String numStr){
        String[] numsList = numStr.split(";");
        for(int i=0; i < numsList.length ; i++){
            List<Object> input = new LinkedList<>();
            input.add( stringToIntArray(numsList[i]) );
            inputs.add(input);
        }
    }
    public int[] stringToIntArray(String arrayStr){
        String[] numberList = arrayStr.split(",");
        int[] nums = new int[numberList.length];
        for(int i = 0; i<numberList.length; i++){
            nums[i] = Integer.parseInt(numberList[i]);
        }
        return nums;
    }
}